// 引入 uni-fetch发起请求
import {uniFetch} from './uni-fetch.js'
/**
 * 获取任务列表的接口
 * @param {Object} data {page:页码,pageSize:页数,status:状态码}为必填
 * @returns 
 */
export const getTaskListApi = (data={}) => {
    const defaultParams = {page:1,pageSize:5,status:1}
    const requestData = Object.assign({},defaultParams,data)
    return uniFetch({
        url:'/driver/tasks/list',
        data:requestData
    })
}
/**
 * 获取任务详细信息的接口
 * @param {String} id 任务id
 * @returns 
 */
export const getTaskdetailApi = (id) => {
    return uniFetch({
        url:`/driver/tasks/details/${id}`
    })
}
/**
 * 提交延迟提货信息的api
 * @param {Object} data 
 * @returns 
 */
export const putDelayMessageApi = (data) => {
    return uniFetch({
        url:'/driver/tasks/delay',
        method:'PUT',
        data
    })
}
/**
 * 提货接口
 * @param {Object} data {cargoPickUpPictureList,cargoPictureList}
 * @returns 
 */
export const postTakeDeliveryApi = (data) => {
    return uniFetch({
        url:'/driver/tasks/takeDelivery',
        method:'POST',
        data
    })
}
/**
 * 异常上报的接口
 * @param {Object} data {transportTaskId...}
 * @returns 
 */
export const postReportExceptionApi = (data) => {
    return uniFetch({
        url:'/driver/tasks/reportException',
        method:'POST',
        data
    })
}
/**
 * 交付的接口
 * @param {Object} data {deliverPictureList,id,certificatePictureList}
 * @returns 
 */
export const postDeliverApi = (data) => {
    return uniFetch({
        url:'/driver/tasks/deliver',
        method:'POST',
        data
    })
}
/**
 * 回车登记上传body参数的接口
 * @param {Object} data 
 * @returns 
 */
export const postTruckRegistrationApi = (data) => {
    return uniFetch({
        url:'/driver/tasks/truckRegistration',
        method:'POST',
        data
    })
}
